package com.example.lianxi222.utils;

import android.content.Context;
import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.bumptech.glide.load.resource.bitmap.CenterCrop;
import com.bumptech.glide.load.resource.bitmap.CircleCrop;
import com.example.lianxi222.R;

public class GlideUtils {
    private static GlideUtils glideUtils;
    private GlideUtils(){

    }
    public static GlideUtils getInstance(){
        if(glideUtils==null){
            synchronized (GlideUtils.class){
                if(glideUtils==null){
                    glideUtils=new GlideUtils();
                }
            }
        }
        return glideUtils;
    }
    public void CircleGlide(Context context, String path, ImageView imageView){
        Glide.with(context).load(path)
                .skipMemoryCache(true)
                .placeholder(R.color.alpha_black)
                .error(R.drawable.ic_action_error)
                .transform(new CircleCrop(),new CenterCrop())
                .into(imageView);
    }
}
